package com.zhudoo.zhilian.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class Config {

    @Autowired
    private Environment environment;


    public static String QINIU_ACCESSKEY;
    public static String QINIU_SECRETKEY;
    public static String QINIU_BUCKETNAME;
    public static String QINIU_URL;

    public static String MINIPROGRAM_APPID;
    public static String MINIPROGRAM_SECRET;

    @PostConstruct
    public void init() {
        QINIU_ACCESSKEY = environment.getProperty("qiniu.accessKey");
        QINIU_SECRETKEY = environment.getProperty("qiniu.secretKey");
        QINIU_BUCKETNAME = environment.getProperty("qiniu.bucketName");
        QINIU_URL = environment.getProperty("qiniu.url");
        MINIPROGRAM_APPID = environment.getProperty("miniprogram.appid");
        MINIPROGRAM_SECRET = environment.getProperty("miniprogram.secret");
    }
}
